public class Date {
    public int year = 2024;
    public int month = 8;
    public int day = 15;

    public void setDate(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void printDate(){
        System.out.println(year+"/"+month+"/"+day);
    }

    public static void main(String[] args) {
        Date date = new Date();
//        date.setDate(2024,8,10);
//        date.printDate();

//        Date date2 = new Date();
//        date2.setDate(2025,9,11);
//        date2.printDate();
//        Date date = new Date(2025,8,16);
//        date.printDate();
        System.out.println(date.toString());
    }
//    public Date(int year,int month,int day){
//        this.year = year;
//        this.month = month;
//        this.day = day;
//    }
//        public Date(){
//            year = 2025;
//            month = 8;
//            day = 15;
//        }

    //代码块
        {
            year = 2023;
            month = 8;
            day = 15;
            System.out.println("代码块初始化");
        }
        public String toString() {
            return year + "-" + month + "-" + day ;
        }
}
